<?php
/**
 * Descript
 * User: blue
 * Date: 2018/8/14 15:59
 */

namespace app\libs\exception;


use think\Exception;
use Throwable;

class BaseException extends Exception
{
    public $httpCode=400;
    public $message='Base custom error';
    public $errCode=ErrDict::BASE_SERVER_ERROR;

    public function __construct($arr=[])
    {
        //防护性代码
        if(!is_array($arr))return;
        array_key_exists('httpCode',$arr)&&$this->httpCode=$arr['httpCode'];
        array_key_exists('message',$arr)&&$this->message=$arr['message'];
        array_key_exists('errCode',$arr)&&$this->errCode=$arr['errCode'];
    }
}